package gui.win.data.add;

import gui.Segl1;
import gui.utils.Borders;
import gui.utils.ComboBox;
import gui.utils.FilePicker;
import gui.utils.InputText;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
import javax.swing.JFrame;
import javax.swing.JPanel;

/*Author: John Archer, Contact: john.archer.jpa@gmail.com*/
public class AddD extends JFrame{
    private InputText InputTextField;
    private FilePicker FileChoosingBox;
    public AddD(Segl1 Seg_L1){
        super();
        this.setLocation(Seg_L1.getLocationOnScreen().x + 50, Seg_L1.getLocationOnScreen().y + 50);
        this.setLayout(new FlowLayout());
        this.setSize(new Dimension(400, 208));
        JPanel p = new JPanel();
        p.setBorder(Borders.getTitledBorder(Borders.STANDARD_TITLED_BORDER, "ADD DATASET"));
        p.setLayout(new BorderLayout());
        p.add(InputTextField = new InputText("TITLE", 32), BorderLayout.NORTH);
        JPanel p0 = new JPanel();
        p0.setLayout(new BorderLayout());
        p0.add(new ComboBox("PROJECT", ComboBox.PROJECT_SELECT_ADDING_REMOVING, 310, 25), BorderLayout.NORTH);
        p0.add(FileChoosingBox = new FilePicker("DATA (FASTQ)",true, 19, 154), BorderLayout.SOUTH);
        p.add(p0, BorderLayout.CENTER);
        this.add(p, BorderLayout.CENTER);
        this.add(new Buttons(Seg_L1, this), BorderLayout.SOUTH);
        this.setVisible(true);
        this.setAlwaysOnTop(true);
    }
    public String getDatasetTitle(){return InputTextField.getText();}
    public String getPathToDataset(){return FileChoosingBox.getPath();}
    public void closeFrame(){this.dispose();}
}